package com.project.controller.ZLGLcontroller;

import com.github.pagehelper.PageInfo;
import com.project.bean.CustomerBean;
import com.project.bean.SupplierBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("supplier")
public class SupplierController {
    @Autowired
    private com.project.service.ZLGLService.ISupperService service;

    @RequestMapping("add")
    public String add( SupplierBean supplier){
        service.add(supplier);
        return "ok";
    }

    @RequestMapping("update")
    public String update(int id,String incharge, String tel) {
        service.update( id,incharge,tel);
        return "ok";
    }

    @RequestMapping("findById")
    public SupplierBean findById(int id ) {
        return service.findById(id );
    }

    @RequestMapping("findByItem")
    public PageInfo<SupplierBean> cutAllByItem(int pageNO, String name, String scope) {
        return service.cutAllByItem(pageNO, name, scope);
    }

    @RequestMapping("findAll")
    public List<SupplierBean> findAll(){
        return service.findAll();
    }

}

